import { UPDATE_WS_STATUS, SET_MARK_PRICE } from "@/store/types";

const contract = {

	namespaced: true,

	state: {

		wsStatus: false,

		channel: [
			JSON.stringify( {
				args: ['mark:btc_usdt'],
				op: 'subscribe'
			})
		],
		data: {
			markPrice: {}
		}
	},

	mutations: {
		/**
		 *  更新websocket状态
		 * @param state
		 * @param payload
		 */
		[UPDATE_WS_STATUS](state, payload) {
			state.wsStatus = payload
		},

		/**
		 * 更新标记价格
		 * @param state
		 * @param payload
		 */
		[SET_MARK_PRICE](state, payload) {
			state.data.markPrice = payload
		}
	},

	actions: {

	}
}

export default contract
